package com.polaris.server.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.polaris.common.utils.RespBean;
import com.polaris.server.dto.LogLoginParam;
import com.polaris.server.pojo.LogLogin;
import com.polaris.server.service.ILogLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author polaris
 * @since 2021-06-08
 */
@Api(tags = "登录日志管理")
@RestController
@RequestMapping("/api/log/login")
public class LogLoginController {

    private final ILogLoginService logLoginService;

    public LogLoginController(ILogLoginService logLoginService) {
        this.logLoginService = logLoginService;
    }

    @ApiOperation(value = "检索登陆日志")
    @GetMapping("/list")
    public RespBean selectByParam(@RequestParam Integer page, @RequestParam Integer limit, @RequestBody @Validated LogLoginParam param){
        Page<LogLogin> objectPage = new Page<>(page, limit);
        return logLoginService.selectByParam(param, objectPage);
    }

}
